import Content from '@/sheep/layouts/content.vue';
import { request } from '@/sheep/request';
import { SELECT, CRUD } from '@/sheep/request/crud';

const route = {
  path: 'merchant',
  name: 'supply.admin.merchant',
  component: Content,
  meta: {
    title: '供应链门店管理',
  },
  children: [
    {
      path: 'team',
      name: 'supply.admin.merchant.team',
      component: () => import('./team/index.vue'),
      meta: {
        title: '团队长管理',
      },
    },
    {
      path: 'apply',
      name: 'supply.admin.merchant.apply',
      component: () => import('./apply/index.vue'),
      meta: {
        title: '商家申请管理',
      },
    },
    {
      path: 'list',
      name: 'supply.admin.merchant.list',
      component: () => import('./apply/index.vue'),
      meta: {
        title: '商家申请管理',
      },
    }
  ],
};

const api = {
  merchant: {
    supply: (params) =>
      request({
        url: `operations/admin/supplierApply`,
        method: 'get',
        params,
      }),

    team: (id) =>
      request({
        url: `shop/admin/commission/agent/team/${id}`,
        method: 'GET',
      }),
  },
  application:{
    list: (params) =>
      request({
        url: '/operations/admin/apply',
        method: 'GET',
        params,
      }),
    audit: (id, data) =>
      request({
        url: `/operations/admin/apply/audit/${id}`,
        method: 'POST',
        data,
      }),
    detail: (id) =>
      request({
        url: `/operations/admin/apply/${id}`,
        method: 'GET',
      }),
  }
};

export { route, api };
